#include "Socket.hpp"

#include <sys/socket.h>
#include <stdio.h>
#include <unistd.h>
namespace xkk
{

Socket::Socket()
{
    _fd=socket(AF_INET,SOCK_STREAM,0);
    if(_fd==-1){
        perror("socket");
    }
    
}

Socket::Socket(int fd)
    :_fd(fd)
{}

void Socket::shutdownWrite()
{
    ::shutdown(_fd,SHUT_WR);
}

Socket::~Socket()
{
    ::close(_fd);
}

}//end of namespace xkk
